/// <reference path="../global.d.ts" />

import Config, { BaseConfig } from "./config";

class Store<ConfigType extends BaseConfig> {
  constructor(reactive: Function, data: {
    config: ConfigType
  }) {
    /** 初始化Config */
    this.config = new Config(reactive, data.config);
  }

  /** 全局配置, 除了项目启动前的配置配置在utils/config外, 其他配置都放在这里 */
  readonly config: Config<ConfigType>;
}

/**
 * 直接导出类而非单例, 有助于进行二次扩展
 */
export default Store;

export { BaseConfig } from "./config";

export { default as StoreInterface } from "./StoreInterface";
